<template>
  <a @click="toDetail">{{ item.name }}</a>
  <StoreDetail :id="item.id" v-if="item && modal == 'open'" @close="onClose" />
</template>

<script setup>
import { ref } from 'vue';
import StoreDetail from './StoreDetail.vue';
const props = defineProps(['item'])

const modal = ref()

const toDetail = () => {
  modal.value = 'open'
}

const onClose = () => {
  modal.value = null
}

</script>

<style lang="less" scoped></style>